<?php
session_start();
include_once '../connectBDD.php';
$result = mysql_query("SELECT * FROM User where login ='" . $_SESSION['login'] . "'");

while ($row = mysql_fetch_assoc($result)) {
                
echo "<div id='infoPers_gauche'>
        <div class='sousTitreInfo'>Nom
            <span id='modifierInfo' >
                <a id='modifNom' href=\"javascript:modifierInfo('Nom')\">modifier</a>
                <a id='cacherNom' href=\"javascript:cacher('Nom')\">cacher</a>
            </span>
        </div>
        <div id='infoNom'>" . $row['last_name'] . "</div>
        <div id='formNom'>
            <form action='' method='post'>
            <label for='nom'>Nom : </label><input type='text' name='nom' value='' id='inputNom'/><br />
            <input type='submit' value='enregistrer' name='bouton'/>
           </form>
           <span class='error' id='error_1' style='display:none'> Remplissez correctement le champs</span>
           <span class='success' id='success_1' style='display:none'> Modifications enregistrées</span>
        </div>

        <div class='sousTitreInfo'>Prenom
            <span id='modifierInfo' >
                <a id='modifPrenom'href=\"javascript:modifierInfo('Prenom')\">modifier</a>
                <a id='cacherPrenom' href=\"javascript:cacher('Prenom')\">cacher</a>
            </span>
        </div>
        <div id='infoPrenom'>" . $row['first_name'] . "</div>
        <div id='formPrenom'>
        <form action='' method=\"post\">
            <label for='prenom'>Prenom : </label><input type='text' name='prenom' value='' id='inputPrenom'/><br />
            <input type='submit' value='enregistrer' name='bouton'/>
        </form>
        <span class='error' id='error_2' style='display:none'> Remplissez correctement le champs</span>
        <span class='success' id='success_2' style='display:none'> Modifications enregistrées</span>
        </div>

        <div class='sousTitreInfo'>Date de naissance
            <span id='modifierInfo' >
                <a id='modifDateNaiss' href=\"javascript:modifierInfo('DateNaiss')\">modifier</a>
                <a id='cacherDateNaiss' href=\"javascript:cacher('DateNaiss')\">cacher</a>
            </span>
        </div>
        <div id='infoDateNaiss'>" . date_format(new DateTime($row['birthdate']), 'd-m-Y') . "</div>
        <div id='formDateNaiss'>
        <form action=\"monCompte.php\" method=\"post\">
        <label for='datenaiss'>Date de naissance : </label><input type='text' name='datenaiss' value='' id='inputDateNaiss'/><br />
        <input type='submit' value='enregistrer' name='bouton'/>
        </form>
        <span class='error' id='error_3' style='display:none'> Remplissez correctement le champs</span>
        <span class='success' id='success_3' style='display:none'> Modifications enregistrées</span>
        </div>

        <div class='sousTitreInfo'>Mail
            <span id='modifierInfo'>
                <a id='modifMail' href=\"javascript:modifierInfo('Mail')\">modifier</a>
                <a id='cacherMail' href=\"javascript:cacher('Mail')\">cacher</a>
            </span>
        </div>
        <div id='infoMail'>" . $row['mail'] . "</div>
        <div id='formMail'>
        <form action=\"monCompte.php\" method=\"post\">
        <label for='mail'>Mail : </label><input type='text' name='mail' value='' id='inputMail'/><br />
        <input type='submit' value='enregistrer' name='bouton' />
        </form>
        <span class='error' id='error_4' style='display:none'> Remplissez correctement le champs</span>
        <span class='success' id='success_4' style='display:none'> Modifications enregistrées</span>
        </div>
    </div>
    <div id='avatar'>
    <a href='editImageProfile.php'>
        <img src='" . $row['avatar_path'] . "' height='300px' width='290px'/>
    </a>";
 
                }
?>
